﻿namespace Liphofra.Mvvm.Validation
{
    /// <summary>
    /// Describes a validation manager implementation.
    /// </summary>
    public interface IValidationManager
    {
        /// <summary>
        /// Validates the specified target.
        /// </summary>
        /// <typeparam name="T">The type of the target.</typeparam>
        /// <param name="target">The target to validate.</param>
        /// <returns>A list of validation results indicating the result of the individual validation rules used for validation.</returns>
        ValidationResults Validate<T>(T target);

        /// <summary>
        /// Validates the specified property of the target.
        /// </summary>
        /// <typeparam name="T">The type of the target.</typeparam>
        /// <param name="target">The target to validate.</param>
        /// <param name="propertyName">The name of the property to validate on the target.</param>
        /// <returns>A list of validation results indicating the result of the individual validation rules used for validation.</returns>
        ValidationResults ValidateProperty<T>(T target, string propertyName);

        /// <summary>
        /// Validates all properties for specified target type.
        /// </summary>
        /// <typeparam name="T">The type of the target.</typeparam>
        /// <param name="target">The target to validate.</param>
        /// <returns>
        /// A list of validation results indicating the result of the individual validation rules used for validation.
        /// </returns>
        ValidationResults ValidateAllProperties<T>(T target);
    }
}